package org.example.day01;

public class MyThread6 extends Thread{
    @Override
    public void run() {
        super.run();
        try {
            for (int i = 0; i < 100000; i++) {
                System.out.println(i);
            }
            System.out.println(Thread.currentThread().isInterrupted() + "当前线程是否中断"); //true
            System.out.println("run begin**");
            Thread.sleep(200000);
            System.out.println("run end**");
        } catch (InterruptedException e) {
            e.printStackTrace();
            System.out.println("先停止，再进入sleep!");
        }
    }

    public static void main(String[] args) {
        MyThread6 m6 = new MyThread6();
        m6.start();
        m6.interrupt();
        System.out.println("main end!");
        System.out.println(m6.isInterrupted() + "**");
    }
}
